
public class CreditCard extends Card 
{
	/**
	 * you cannot spend more than this limit
	 */
	private double fLimit;
	/**
	 * current amount left in credit card.
	 */
	private double fBalance; 
	/**
	 * The limit of the Credit card as a default
	 */
	private double LIMIT = 2500;
	/**
	 * The current balance of the card at initialization
	 */
	private double BALANCE = 0;
	/**
	 * creates a basic credit card with no account tied to it and default limit.
	 * @param name the card owner's name
	 * @param street the card owner's street
	 * @param town the card owner's town
	 * @param zipCode the card owner's town zip code
	 * @param country the card owner's country
	 */
	public CreditCard(String name, String street, String town, String zipCode, String country)
	{
		fName = name;
		fStreet = street;
		fTown = town;
		fzipCode = zipCode;
		fCountry = country;
		fLimit = LIMIT; // standard limit
		fBalance = BALANCE;
	}
	/**
	 * creates a credit card with an account tied to it and an unique limit.
	 * @param name the card owner's name
	 * @param street the card owner's street
	 * @param town the card owner's town
	 * @param zipCode the card owner's town zip code
	 * @param country the card owner's country
	 * @param account the account connected to this credit card
	 */
	public CreditCard(String name, String street, String town, String zipCode, String country, double limit, CheckingAccount account)
	{
		fName = name;
		fStreet = street;
		fTown = town;
		fzipCode = zipCode;
		fCountry = country;
		fLimit = limit;
		fBalance = BALANCE;
		fAccountConnectedTo = account;

	}
	/**
	 * method that sees if you can pay for an item
	 * if you can decreases the current balance
	 * @param amount the amount of the item
	 * @return true if you can purchase false otherwise
	 */
	public boolean pay(double amount)
	{
		if((fBalance - amount) >= -fLimit)
		{
			fBalance -= amount;
			return true;
		}
		else
		{
			return false;
		}
	}
	public double getfLimit() {
		return fLimit;
	}
}
